

const baseUrl = 'http://127.0.0.1:7001/api';
import axios from 'axios'


export const getBanner = ():Promise<Banner[]> =>{
    const url = '/banners';

    // return fetch(`${baseUrl}${url}`).then(res=>{
    //     console.log(res.constructor);
    //     return res.text()
    // });

    return axios.get(`${baseUrl}${url}`).then(res=>{
        // res.data =eval(`${res.data}`)
        return res.data
    });
}


export const getPlaylist=()=>{
    const url = '/playlist/top';
    return axios.get(`${baseUrl}${url}`).then(res=>{
        // res.data =eval(`${res.data}`)
        return res.data
    });
}